<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort();
System.out.println(basePath);
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>
<s:property value="userDetial.username"/>
的友邻动态
</title>
<link href="css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/tools/jquery-1.4.2.min.js"></script>
<script type="text/javascript">
 function addReplay(id,count)
		 {
		     var content=$.trim($("#content"+id).val());
		     var login='<s:property value="#session.user.email"/>';
		     if(login!="")
		     {
			     if(content.length<0||content.length>100)
			     {
			        alert("内容字数在1~300！");
			        return false;
			     }
			    
			     $.post("groupbyajax/user!addReplay.action",{dynamicId:id,content:content},function(data){
			      var html='<div style="border-bottom: 1px dashed #565656;">'+
		                   '&nbsp;&nbsp;&nbsp;&nbsp;'+data.success.content+
		                   '</div>';
			         $("#contentShow"+id).append(html);
			         $("#content"+id).val("");
			           $("#"+count).text(parseInt($("#"+count).text())+1);
			    });
		    }else
		    {
		       alert("请登录！");
		    }
		 }
		  function contentShow(obj,id)
		 {
		 
		    
		     if($("#contentShow"+id).css("display")!="none")
		     {
		        $(obj).html("回应");
		        $("#contentShow"+id).hide();
		        $("#contentBut"+id).hide();
		     }else
		     {
		       $(obj).html("隐藏回应");
		        $("#contentShow"+id).show();
		        $("#contentBut"+id).show();
		        
		     }
		 }
</script>
</head>

<body>
<div class="container">
<jsp:include page="../head.jsp"/> 
<div class="ge"></div>

<div class="content">
<div class="wrapp">
<div class="album_left"> 
<a href="user/user!singleUserPage.action?userId=<s:property value='users.id'/>&currentPage=1">
                     <s:if test="userDetial.image.equals('')">
				          <img src="images/img.gif"  class="img4"  />
				      </s:if>
				      <s:else>
				         <img src="uploadFile/<s:property value="userDetial.image"/>" class="img4"  />
		              </s:else>
		              </a>
		 </div>
<div class="album_right">
<div class="album_ding"><a >
<s:if test="userDetial.username!=''">
			        <s:property value='userDetial.username'/>
				</s:if>
				<s:elseif test="userDetial.eusername!=''">
				    <s:property value='userDetial.eusername'/>
				</s:elseif>
				<s:else>
				    <s:property value='users.email.substring(0,users.email.indexOf("@"))'/>
				</s:else>
的友邻动态</a></div>
<div class="album_di">
<a href="user/user!singleUserPage.action?userId=<s:property value='users.id'/>&currentPage=1" >首页</a>&nbsp;&nbsp;
			<a href="user/user!dynamicList.action?currentPage=1&userId=<s:property value='users.id'/>" target="_parent">动态</a>&nbsp;&nbsp;
			<a href="user/user!brandUserList.action?currentPage=1&userId=<s:property value='users.id'/>" target="_parent">品牌</a>&nbsp;&nbsp;
			<a href="user/user!myFriendList.action?currentPage=1&userId=<s:property value="users.id"/>"  target="_parent">友邻</a>&nbsp;&nbsp;
			<a href="user/user!feedBack.action?currentPage=1&userId=<s:property value="users.id"/>" target="_parent">留言</a>
</div>
</div>
<div class="clear"></div>
</div>
<div class="wrap">
      <div class="left">
	       <div class="dongtai">
			         <div class="dongtai_top"><a href="javascript:void(0);" target="_parent">好友动态</a>
					 </div>
					 <div class="dongtai_con">
					      <ul>
					       <s:iterator value="dynamicList" id="id" status="status">
					       <s:if test="#id[0][9]==2">
			                      <s:set name="url1">user/user!singleUserPage.action?currentPage=1&userId=<s:property value="#id[0][0]"/></s:set>
							   </s:if>
							   <s:elseif test="#id[0][9]==3">
							      <s:set name="url1">user/user!groupbyUserPage.action?currentPage=1&userId=<s:property value="#id[0][0]"/></s:set>
							   </s:elseif>
							   <s:elseif test="#id[0][9]==4">
							      <s:set name="url1">user/user!brandUserPage.action?currentPage=1&userId=<s:property value="#id[0][0]"/></s:set>
							   </s:elseif>
					           <s:if test="#id[0][10]==2">
			                      <s:set name="url2">user/user!singleUserPage.action?currentPage=1&userId=<s:property value="#id[0][3]"/></s:set>
							   </s:if>
							   <s:elseif test="#id[0][10]==3">
							      <s:set name="url2">user/user!groupbyUserPage.action?currentPage=1&userId=<s:property value="#id[0][3]"/></s:set>
							   </s:elseif>
							   <s:elseif test="#id[0][10]==4">
							      <s:set name="url2">user/user!brandUserPage.action?currentPage=1&userId=<s:property value="#id[0][3]"/></s:set>
							   </s:elseif>
							   <s:elseif test="#id[0][10].equals('-1')">
							      <s:set name="url2"><s:property value="#id[0][5].split(',')[1]"/></s:set>
							   </s:elseif>
					         <s:if test="#id[0][7]==1">
					        
					           <li>
							    <div class="boxd1"><img src="<s:property value="#id[0][1]"/>" /></div>
							    <div class="boxd2">
							    <div class="dt1">
							    <a href="${url1}" target="_parent" class="red"><s:property value="#id[0][2]"/>
							     </a>
							     关注了<a href="${url2}" target="_parent" class="red"><s:property value="#id[0][5]"/></a></div>
							    <div class="dt2"></div></div>
							    <div class="boxd3"><a href="${url2 }" target="_parent" class="red"><img src="<s:property value="#id[0][4]"/>" width=60 height=60 /></a></div>
							    <div class="clear"></div>
						     </li>
					        </s:if>
					        <s:elseif test="#id[0][7]==2">
					         
					           <li>
							    <div class="boxd1"><img src="<s:property value="#id[0][1]"/>"  /></div>
							    <div class="boxd2">
							    <div class="dt1"><a href="${url1 }" target="_parent" class="red"><s:property value="#id[0][2]"/>
							     </a>关注了<a href="${url2 }" target="_parent" class="red"><s:property value="#id[0][5]"/></a></div>
							    <div class="dt2"></div></div>
							    <div class="boxd3"><a href="${url2 }" target="_parent" class="red"><img src="<s:property value="#id[0][4]"/>" width=60 height=60/></a></div>
							    <div class="clear"></div>
						     </li>
					        </s:elseif>
					         <s:elseif test="#id[0][7]==3">
					          <li>
							  <div class="boxd1"><img src="<s:property value="#id[0][1]"/>" /></div>
							  <div class="boxd2">
	                              <div class="dt1"><a href="${url1 }" target="_parent" class="red"><s:property value="#id[0][2]"/></a>评价了<a href="${url2 }" target="_parent" class="red"><s:property value="#id[0][5]"/></a>品牌</div>
		                          <div class="pingjia"> 
		                                 &nbsp;&nbsp;
		                             <span class="tuan" ><s:property value="#id[0][6]"/>&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:void(0);" onclick="contentShow(this,'<s:property value="#id[0][8]"/>')" style="color:#9C2684;">回应</a>(<span id="count<s:property value="#id[0][8]"/>" style="color:#9C2684;"></span><s:property value="#id[1].size()"/></span>)</span>
		                             <div id="contentShow<s:property value="#id[0][8]"/>" style="display:none;color:#565656">
		                              <s:iterator value="#id[1]" >
		                              <div style="border-bottom:1px dashed #CCCCCC;">
		                                &nbsp;&nbsp;&nbsp;&nbsp;<s:property value="content"/>-
		                                <s:if test="userInfor.split(',')[2]==2">
		                                   <a href="user/user!singleUserPage.action?userId=<s:property value="userInfor.split(',')[1]"/>&currentPage=1"  style="color:#9C2684"><s:property value="userInfor.split(',')[0]"/></a>
		                                </s:if>
		                                <s:elseif test="userInfor.split(',')[2]==3">
		                                    <a href="user/user!groupbyUserPage.action?currentPage=1&userId=<s:property value="userInfor.split(',')[1]"/>"  style="color:#9C2684"><s:property value="userInfor.split(',')[0]"/></a>
		                                </s:elseif>
		                                <s:elseif test="userInfor.split(',')[2]==4">
		                                     <a href="user/user!brandUserPage.action?currentPage=1&userId=<s:property value="userInfor.split(',')[1]"/>"  style="color:#9C2684"><s:property value="userInfor.split(',')[0]"/></a>
		                                </s:elseif>
		                                
		                                </div>
		                              </s:iterator>
		                             </div>
		                          </div>
	                              <div class="dt2" id="contentBut<s:property value="#id[0][8]"/>" style="display:none;">
	                              <input type="text" id="content<s:property value="#id[0][8]"/>" size="30" />
	                              <a href="javascript:void(0)" onclick="addReplay(<s:property value="#id[0][8]"/>,'count<s:property value="#id[0][8]"/>')" target="_parent" >发表回应</a>&nbsp;&nbsp;
	                              <a href="${url2 }" target="_blank">去看看</a>&nbsp;&nbsp;</div>
	                              
	                          </div>
							  <div class="boxd3"><a href="${url2 }" target="_parent" class="red"><img src="<s:property value="#id[0][4]"/>" width=60 height=60 /></a></div>
							  <div class="clear"></div>
							 </li>
					        </s:elseif>
					        <s:elseif test="#id[0][7]==4">
					        
					           <li>
							    <div class="boxd1"><img src="<s:property value="#id[0][1]"/>" /></div>
							    <div class="boxd2">
							    <div class="dt1"><a href="${url1}" target="_parent" class="red"><s:property value="#id[0][2]"/>
							     </a>关注了<a href="${url2}" target="_blank" class="red"><s:property value="#id[0][5].split(',')[0]"/></a>的团购活动</div>
							    <div class="dt2"></div></div>
							    <div class="boxd3"><a href="${url2 }" target="_parent" class="red"><img src="<s:property value="#id[0][4]"/>" width=165 height=109/></a></div>
							    <div class="clear"></div>
						     </li>
					        </s:elseif>
					        
					        <s:elseif test="#id[0][7]==5">
						     <li>
							  <div class="boxd1"><img src="<s:property value="#id[0][1]"/>" /></div>
							  <div class="boxd2">
	                              <div class="dt1"><a href="${url1 }" target="_parent" class="red"><s:property value="#id[0][2]"/></a>评价了<a href="${url2 }" target="_blank" class="red"><s:property value="#id[0][5].split(',')[0]"/></a>的团购活动</div>
		                          <div class="pingjia"> 
		                                 &nbsp;&nbsp;
		                             <span class="tuan"><s:property value="#id[0][6]"/>&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:void(0);" onclick="contentShow(this,'<s:property value="#id[0][8]"/>')" style="color:#9C2684;">回应</a>(<span id="count<s:property value="#id[0][8]"/>" style="color:#9C2684;"><s:property value="#id[1].size()"/></span>)</span>
		                             <div id="contentShow<s:property value="#id[0][8]"/>" style="display:none;color:#565656">
		                              <s:iterator value="#id[1]" >
		                              <div style="border-bottom:1px dashed #CCCCCC;">
		                                &nbsp;&nbsp;&nbsp;&nbsp;<s:property value="content"/>-
		                                <s:if test="userInfor.split(',')[2]==2">
		                                   <a href="user/user!singleUserPage.action?userId=<s:property value="userInfor.split(',')[1]"/>&currentPage=1" style="color:#9C2684"><s:property value="userInfor.split(',')[0]"/></a>
		                                </s:if>
		                                <s:elseif test="userInfor.split(',')[2]==3">
		                                    <a href="user/user!groupbyUserPage.action?currentPage=1&userId=<s:property value="userInfor.split(',')[1]"/>" style="color:#9C2684"><s:property value="userInfor.split(',')[0]"/></a>
		                                </s:elseif>
		                                <s:elseif test="userInfor.split(',')[2]==4">
		                                     <a href="user/user!brandUserPage.action?currentPage=1&userId=<s:property value="userInfor.split(',')[1]"/>" style="color:#9C2684"><s:property value="userInfor.split(',')[0]"/></a>
		                                </s:elseif>
		                                
		                                
		                                </div>
		                              </s:iterator>
		                             </div>
		                          </div>
	                              <div class="dt2" id="contentBut<s:property value="#id[0][8]"/>" style="display:none;">
	                              <input type="text" id="content<s:property value="#id[0][8]"/>" size="30" />
	                              <a href="javascript:void(0)" onclick="addReplay(<s:property value="#id[0][8]"/>,'count<s:property value="#id[0][8]"/>')" target="_parent">发表回应</a>&nbsp;&nbsp;
	                              <a href="<s:property value="#id[0][5].split(',')[1]"/>" target="_blank">去看看</a>&nbsp;&nbsp;</div>
	                              
	                          </div>
							  <div class="boxd3"><a href="${url2 }" target="_parent" class="red"><img src="<s:property value="#id[0][4]"/>" width=165 height=109 /></a></div>
							  <div class="clear"></div>
							 </li>
					        </s:elseif>
					        <s:elseif test="#id[0][7]==6">
					          
					           <li>
							    <div class="boxd1"><img src="<s:property value="#id[0][1]"/>"  /></div>
							    <div class="boxd2">
							    <div class="dt1"><a href="${url1 }" target="_parent" class="red"><s:property value="#id[0][2]"/>
							     </a>关注了<a href="${url2 }" target="_parent" class="red"><s:property value="#id[0][5].split(',')[0]"/></div>
							    </div>
							    <div class="boxd3"><a href="${url2 }" target="_parent" class="red"><img src="<s:property value="#id[0][4]"/>" width=60 height=60/></a></div>
							    <div class="clear"></div>
						     </li>
					        </s:elseif>
					       <s:elseif test="#id[0][7]==7">
					         
						     <li>
							  <div class="boxd1"><img src="<s:property value="#id[0][1]"/>" /></div>
							  <div class="boxd2">
	                              <div class="dt1">
	                                     <a href="${url1 }" target="_parent" class="red"><s:property value="#id[0][2]"/></a>评价了<a href="${url2 }" target="_parent" class="red"><s:property value="#id[0][5]"/></a>团购网</div>
		                          <div class="pingjia"> 
		                                 &nbsp;&nbsp;
		                             <span class="tuan" ><s:property value="#id[0][6]"/>&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:void(0);" onclick="contentShow(this,'<s:property value="#id[0][8]"/>')" style="color:#9C2684;">回应</a>(<span id="count<s:property value="#id[0][8]"/>" style="color:#9C2684;"><s:property value="#id[1].size()"/></span>)</span>
		                             <div id="contentShow<s:property value="#id[0][8]"/>" style="display:none;color:#565656">
		                              <s:iterator value="#id[1]" >
		                              <div style="border-bottom:1px dashed #CCCCCC;">
		                                &nbsp;&nbsp;&nbsp;&nbsp;<s:property value="content"/>-
		                                <s:if test="userInfor.split(',')[2]==2">
		                                   <a href="user/user!singleUserPage.action?userId=<s:property value="userInfor.split(',')[1]"/>&currentPage=1" style="color:#9C2684"><s:property value="userInfor.split(',')[0]"/></a>
		                                </s:if>
		                                <s:elseif test="userInfor.split(',')[2]==3">
		                                    <a href="user/user!groupbyUserPage.action?currentPage=1&userId=<s:property value="userInfor.split(',')[1]"/> style="color:#9C2684""><s:property value="userInfor.split(',')[0]"/></a>
		                                </s:elseif>
		                                <s:elseif test="userInfor.split(',')[2]==4">
		                                     <a href="user/user!brandUserPage.action?currentPage=1&userId=<s:property value="userInfor.split(',')[1]"/> style="color:#9C2684""><s:property value="userInfor.split(',')[0]"/></a>
		                                </s:elseif>
		                                </div>
		                                
		                              </s:iterator>
		                             </div>
		                          </div>
	                              <div class="dt2" id="contentBut<s:property value="#id[0][8]"/>" style="display:none;"><input type="text" id="content<s:property value="#id[0][8]"/>" size="30" />
	                              <a href="javascript:void(0)" onclick="addReplay(<s:property value="#id[0][8]"/>,'count<s:property value="#id[0][8]"/>')" target="_parent">发表回应</a>&nbsp;&nbsp;
	                              <a href="user/user!groupbyUserPage.action?currentPage=1&userId=<s:property value="#id[0][3]"/>" target="_blank">去看看</a>&nbsp;&nbsp;</div>
	                              
	                          </div>
							  <div class="boxd3"><a href="${url2 }" target="_parent" class="red"><img src="<s:property value="#id[0][4]"/>" width=60 height=60 /></a></div>
							  <div class="clear"></div>
							 </li>
					        </s:elseif>
					      </s:iterator>
						 
						  </ul>
						  <div class="clear"></div>
					 </div>
					 
			  </div>		
<!--end好友动态-->

 <div class="ye">
  <s:if test="#request.dynamicList.size()!=0">
			                <s:set name="paramStr">user/user!dynamicList.action?userId=${userId}&currentPage=</s:set>
							<a href="${paramStr}1">第一页</a>&nbsp;&nbsp;<a href="${paramStr}<s:property value="#request.pages.prePage"/>">上一页</a>
							  
							   <s:set name="totalPage" value="#request.pages.totalPage"></s:set>
							   
							   <s:set name="currentPage" value="#request.pages.currentPage"></s:set>
							   <s:if test="#currentPage<=0">
							      <s:set name="currentPage" value="1"></s:set>
							   </s:if>
							   <s:elseif test="#currentPage>#totalPage">
							      <s:set name="currentPage" value="#totalPage"></s:set>
							   </s:elseif>
							   
							   <s:if test="#totalPage%8>0">
							       <s:set name="pageSize" value="#totalPage/8+1"></s:set>
							   </s:if>
							   <s:else>
							       <s:set name="pageSize" value="#totalPage/8"></s:set>
							   </s:else>
							  
							   
							   <s:if test="#currentPage%8>0">
							       <s:set name="cPageSize" value="#currentPage/8+1"></s:set>
							   </s:if>
							   <s:else>
							       <s:set name="cPageSize" value="#currentPage/8"></s:set>
							   </s:else>
							   
							   <s:set name="first" value="8*(#cPageSize-1)"></s:set>
							   <s:if test="#first==0">
							      <s:set name="first" value="1"></s:set>
							   </s:if>
							   <s:set name="last" value="#cPageSize*8"></s:set>
							   <s:if test="#last>#totalPage">
							      <s:set name="last" value="#totalPage"></s:set>
							   </s:if>
				
							     <s:bean name="org.apache.struts2.util.Counter" id="counter"> 
							       <s:param name="first" value="#first"/>
							       <s:param name="last" value="#last" />
							       <s:iterator status="status"> 
							          
							         <s:if test="#currentPage==(#status.index+#first)">
							            &nbsp;&nbsp;<s:a href="%{paramStr}%{#status.index+#first}" cssStyle="background-color:#982987;color:#FFFFFF; padding-right:3px; padding-left:3px;" ><s:property value="#status.index+#first" /></s:a>
							         </s:if>
							         <s:else>
							            &nbsp;&nbsp;<s:a href="%{paramStr}%{#status.index+#first}" ><s:property value="#status.index+#first" /></s:a>
							         </s:else>
							          
							       </s:iterator> 
							     </s:bean>
							     <s:if test="#last<#totalPage">
							       ......&nbsp;
							     </s:if>
							<a href="${paramStr}<s:property value="#request.pages.nextPage"/>">下一页</a>&nbsp;&nbsp;<a href="${paramStr}<s:property value="#request.pages.totalPage"/>">最后一页</a>
					        </s:if>
	   </div> 
	   
</div>
	  
	  
	
	<div class="clear"></div>
	  
	 
	  
    </div>
	
	  
</div>


<div id="foot"><jsp:include page="../bot.jsp"></jsp:include></div>


</div>
</body>
</html>
